import request from '@/utils/request'

// 获取token
export function getMonitorToken() {
  return request({
    url: '/monitor/token',
    method: 'get',
  })
}
export function getToken() {
  return request({
    url: '/monitor/equipmentToken',
    method: 'get',
  })
}

// 监控设备查询
export function listCamera(data) { 
  return request({
    url: '/mon/camera/list',
    method: 'get',
    params: data
  })
}

// 查看设备详情
export function getCamera(id) {
    return request({
      url: '/mon/camera/detail/'+id,
      method: 'get'
    })
  }
// 添加监控设备
export function addCamera(data) {
    return request({
      url: '/mon/camera/add',
      method: 'post',
      data: data
    })
  }

  // 监控设备编辑
export function updateCamera(data) {
    return request({
      url: '/mon/camera/edit',
      method: 'post',
      data: data
    })
  }
  
  // 删除设备编辑
  export function delCamera(id) {
    return request({
      url: '/mon/camera/remove/'+id,
      method: 'post',
    })
  }


  // 摄像头查询
export function listThorough(data) {
    return request({
      url: '/mon/camera_info/list',
      method: 'get',
      params: data
    })
  }
  // 查看摄像头详情
export function getThorough(id) {
    return request({
      url: '/mon/camera_info/detail/'+id,
      method: 'get'
    })
  }
  // 添加摄像头
  export function addThorough(data) {
      return request({
        url: '/mon/camera_info/add',
        method: 'post',
        data: data
      })
    }
  
    // 编辑摄像头
  export function updateThorough(data) {
      return request({
        url: '/mon/camera_info/edit',
        method: 'post',
        data: data
      })
    }
    
    // 删除摄像头
    export function delThorough(id) {
      return request({
        url: '/mon/camera_info/remove/'+id,
        method: 'post'
      })
    }